<template>
  <el-dialog
    :visible.sync="modals"
    scrollable
    :title="title"
    class="order_box"
    :closable="true"
    width="1000"
    :mask-closable="false"
  >
      <el-card :bordered="false"  class="i-table-no-border" shadow="hidden">
        <el-row class="mb10">
          <el-table  :data="log_list">
            <!-- <el-table-column label="操作人类型" min-width="120" #default="{row}">{{row.opUserTypeName}}</el-table-column> -->
            <el-table-column label="操作人" min-width="120" #default="{row}">{{row.operationUserName}}</el-table-column>
            <el-table-column label="操作时间" min-width="120" #default="{row}">{{row.operationTimeStr}}</el-table-column>
            <el-table-column label="操作内容" min-width="200" #default="{row}">{{row.logContent}}</el-table-column>
          </el-table>
        </el-row>
      </el-card>
    <div slot="footer">
      <el-button @click="cancel">关闭</el-button>
    </div>
  </el-dialog>
</template>
  
<script>
import { getOrderInfoApi, getOrderLogApi } from '@/api/onsite';
export default {
  name: 'orderLog',
  props: {
    orderId: Number,
  },
  data() {
    return {
      order_info: null,
      title: '订单日志',
      modals: false,
      log_list: [],
    };
  },
  methods: {
    // 订单详情
    getOrderInfo() {
      getOrderInfoApi(this.orderId)
        .then(async (res) => {
          this.order_info = res;
          this.title = '订单日志：' + this.order_info.ordersn;
        })
        .catch((res) => {
          this.$Message.error(res.msg);
        });
    },
    // 订单日志
    getOrderLog() {
      getOrderLogApi(this.orderId)
        .then(async (res) => {
          console.log(res)
          this.log_list = res;
        })
        .catch((res) => {
          this.$Message.error(res.msg);
        });
    },
    cancel(name) {
      this.modals = false;
      this.$emit('clearId');
    },
  },
};
</script>
  
<style>
.ivu-description-list-title {
  margin-bottom: 30px;
  color: #17233d;
  font-weight: bold;
  font-size: 14px;
}
.ivu-table th {
  background-color: #f8f8f9 !important;
}
</style>
  